import 'package:flutter/material.dart';

class MyApp11 extends StatelessWidget {
  const MyApp11({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text(
          'Stack层叠布局',
          style: TextStyle(
            fontSize: 20,
            fontWeight: FontWeight.bold,
            color: Colors.white,
          ),
        ),
        centerTitle: true,
        backgroundColor: Colors.red,
      ),
      body: Center(
        child: Stack(
          clipBehavior: Clip.none,
          alignment: AlignmentDirectional.center,
          children: [
            Container(width: 200, height: 200, color: Colors.blue),
            Container(width: 150, height: 150, color: Colors.green),
            Container(width: 100, height: 100, color: Colors.red),
            Image.asset('open_eyes.png', width: 50, height: 50),
            Positioned(
              top: -10,
              left: 10,
              child: Container(width: 30, height: 30, color: Colors.yellow),
            ),
            Icon(Icons.ad_units_outlined, size: 100),
          ],
        ),
      ),
    );
  }
}
